<template>
  <div class="header-title">注册成为主播</div>
  <div class="register-header">
    <template v-for="(item, index) in listItems" :key="index">
      <div :class="{ item, todo: activetab < index + 1 }">
        <div class="item-top">
          <div v-if="activetab == index + 1" class="left ing">
            {{ index + 1 }}
          </div>
          <div v-else-if="activetab < index + 1" class="left todo">
            {{ index + 1 }}
          </div>
          <img v-else class="left success" src="@/assets/register/success.svg" />
          <div class="right">{{ item.title }}</div>
        </div>
        <div class="item-bottom">
          {{ item.desc }}
        </div>
      </div>
    </template>
  </div>
</template>
<script lang="ts">
export default {
  name: "RegisterHeader",
};
</script>

<script setup lang="ts">
import { defineProps } from "vue";

const listItems = [
  {
    status: false,
    title: "填写基础信息",
    desc: "主播基础信息",
  },
  {
    status: false,
    title: "上传认证资料",
    desc: "个人认证资料及合同",
  },
  {
    status: false,
    title: "等待审核",
    desc: "上传资料审核",
  },
  {
    status: false,
    title: "创作者质量保证金",
    desc: "缴纳后即可成为主播",
  },
];
/* interface ListItem {
  status: boolean;
  title: string;
  desc: string;
}
 */
// 声明接收的 props
defineProps({
  activetab: {
    type: Number,
    required: true,
    default: 1,
  },
});
</script>

<style lang="scss" scoped>
.header-title {
  width: 75%;
  margin: 0 auto;
  margin-top: 60px;
  color: #1d2129;
  font-size: 20px;
}
.register-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 75%;
  padding: 30px;
  margin: 0 auto;

  .todo {
    background: transparent !important;
    box-shadow: none !important;
  }

  .item {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 25px 40px;
    min-width: 234px;
    border-radius: 5px;
    background: url("@/assets/register/stepBg.png") 100% no-repeat;
    background-position: center;

    &-bottom {
      width: 100%;
      padding-left: 40px;
      margin-top: 6px;
      font-size: 12px;
    }

    &-top {
      display: flex;
      width: 100%;
      font-size: 16px;

      .left {
        width: 28px;
        height: 28px;
        margin-right: 10px;
        border-radius: 50%;
      }

      .ing {
        line-height: 28px;
        color: #ffffff;
        text-align: center;
        background: #165dff;
      }

      .todo {
        line-height: 28px;
        color: #4e5969;
        text-align: center;
        background: #f2f3f5 !important;
      }

      .success {
        background: #e8f3ff;
      }
    }
  }
}
</style>
